import java.util.Scanner;

//题目：一球从100米高度自由落下，每次落地后反跳回原高度的一半；再落下，
// 求它在第10次落地时，共经过多少米？第10次反弹多高？
public class Test10 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("请输入初始下落高度");
        double height = console.nextDouble();
        System.out.println("请输入落地次数");
        int time = console.nextInt();
        int i = 0;
        double arr = height;
        double sum = arr;
        for (i = 1; i < time; i++) {
            arr = arr / 2;
            sum += arr * 2;
        }
        console.close();
        System.out.println("第" + time + "次落地,共经过" + sum + "米");
        System.out.println("第" + time + "次反弹" + arr + "米");
    }
}
